*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*				High-Pressure, High-Paying Jobs?                              /
*               The Review of Economics and Statistics                        /
*                                                                             /
*               Authors: Markus Nagler, Johannes Rincke, Erwin Winkler        /
*                                                                             /
*               Do-File 1: Analysis of experimental data                      /
*                                                                             /
*               This file generates:                                          /
*               - Figures 2,3,4,A.11,A.12,A.13                                /
*               - Tables A.7,A.8,A.9                                          /
*                                                                             /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

use "$orig\HighPressure_attent",clear




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Figure 2, panel (a)                                  /
*                        WTP to avoid tight deadlines                         /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

* Note: differences in job attributes between jobs are always coded such that a positive value means better job characteristics in job A

{
preserve

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,1,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,4,5,6,7), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 6 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -6 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(black))  (scatter counter b if significant==1 , color(black) msymbol(dh) ) (scatter counter b if significant==0 , color(black) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(9.677827, lpattern(dash) lcolor(gs8) lwidth(vthin))  ylabel(20 "{bf:All}" 18 "{bf:Gender}" 17 "Female" 16 "Male" 14 "{bf:Age}" 13 "20-29" 12 "30-39" 11 "40-49" 10 "50-60" 8 "{bf:Education}" 7 "Low" 6 "Medium" 5 "High" 3 "{bf:Wage quintile}" 2 "1st (lowest)" 1 "2nd" 0 "3rd" -1 "4th" -2 "5th (highest)" -4 "{bf: Bad health index}" -5 "Above median" -6 "Below median", angle(0)  labsize(small)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(-7 21)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore
}





*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Figure 2, panel (b)                                  /
*                        WTP to avoid multitasking                            /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{

preserve

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_*, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,1,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,4,5,6,7), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 6 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -6 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(black))  (scatter counter b if significant==1 , color(black) msymbol(dh) ) (scatter counter b if significant==0 , color(black) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(7.073407 , lpattern(dash) lcolor(gs8) lwidth(vthin))  ylabel(20 "{bf:All}" 18 "{bf:Gender}" 17 "Female" 16 "Male" 14 "{bf:Age}" 13 "20-29" 12 "30-39" 11 "40-49" 10 "50-60" 8 "{bf:Education}" 7 "Low" 6 "Medium" 5 "High" 3 "{bf:Wage quintile}" 2 "1st (lowest)" 1 "2nd" 0 "3rd" -1 "4th" -2 "5th (highest)" -4 "{bf: Bad health index}" -5 "Above median" -6 "Below median", angle(0)  labsize(small)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(-7 21)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore
}








*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Figure 3                                             /
*                        Sorting based on preferences                         /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


{
preserve

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==0, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(black))  (scatter counter b if significant==1 , color(black) msymbol(dh) ) (scatter counter b if significant==0 , color(black) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(20 "{bf:Frequent deadlines in current job?}" 19 "Yes" 18 "No" 16 "{bf:Frequent multitasking in current job?}" 15 "Yes" 14 "No", angle(0)  labsize(medium)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(13 21)) xscale(range(0 15) titlegap(4))  xsize(6) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore

}





*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                           Figure 4                                          /
*                           Implications for inequality                       /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{
preserve

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""



*** High vs low education

cap prog drop boot_ineq
program define boot_ineq


gen ln_comp=.
gen ln_comp_tot=.

* High education - deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if high_edu==1 & nofreq_dlines==0 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==0 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==0 & nofreq_mtask==0

cap drop sum_amenities


* High education - deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if high_edu==1 & nofreq_dlines==0 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==0 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==0 & nofreq_mtask==1

cap drop sum_amenities




* High education - no deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if high_edu==1 & nofreq_dlines==1 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==1 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==1 & nofreq_mtask==0

cap drop sum_amenities




* High education - no deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if high_edu==1 & nofreq_dlines==1 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==1 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if high_edu==1 & nofreq_dlines==1 & nofreq_mtask==1

cap drop sum_amenities




* Low education - deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if low_edu==1 & nofreq_dlines==0 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==0 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==0 & nofreq_mtask==0

cap drop sum_amenities




* Low education - deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if low_edu==1 & nofreq_dlines==0 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==0 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==0 & nofreq_mtask==1

cap drop sum_amenities




* Low education - no deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if low_edu==1 & nofreq_dlines==1 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==1 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==1 & nofreq_mtask==0

cap drop sum_amenities




* Low education - no deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if low_edu==1 & nofreq_dlines==1 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==1 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if low_edu==1 & nofreq_dlines==1 & nofreq_mtask==1


cap drop coef_d_tele_2 coef_d_tele_5 coef_wage sum_amenities

* wage gap
sum ln_wage if high_edu==1
gen wage_g1 = r(mean)
sum ln_wage if low_edu==1
gen wage_g2 = r(mean)
gen wage_gap = wage_g1-wage_g2
sum wage_gap 
scalar wage_gap = r(mean)
di wage_gap

* compensation gap (wfh)
sum ln_comp if high_edu==1
gen comp_g1 = r(mean)
sum ln_comp if low_edu==1
gen comp_g2 = r(mean)
gen comp_gap = comp_g1-comp_g2
sum comp_gap
scalar comp_gap = r(mean)
di comp_gap

cap drop comp_g1 comp_g2

* compensation gap (all amenities)
sum ln_comp_tot if high_edu==1
gen comp_g1 = r(mean)
sum ln_comp_tot if low_edu==1
gen comp_g2 = r(mean)
gen comp_gap_tot = comp_g1-comp_g2
sum comp_gap_tot
scalar comp_gap_tot = r(mean)
di comp_gap_tot



gen diff_pressure = comp_gap-wage_gap 
sum diff_pressure 
scalar diff_pressure = r(mean)
di diff_pressure

gen diff_tot = comp_gap_tot-wage_gap 
sum diff_tot 
scalar diff_tot = r(mean)
di diff_tot

cap drop ln_comp ln_comp_tot wage_g1 wage_g2 comp_g1 comp_g2 wage_gap comp_gap comp_gap_tot diff_pressure diff_tot sum_amenities

reg ln_wage

end 


bootstrap wage_gap comp_gap comp_gap_tot diff_pressure diff_tot, seed(2205) reps(200) cluster(ls_id): boot_ineq




local i=`i'+1
mat b = e(b)
replace b = b[1,1] in `i'
mat se = e(se)
replace se = se[1,1] in `i'
replace counter = 20 in `i'


local i=`i'+1
mat b = e(b)
replace b = b[1,2] in `i'
mat se = e(se)
replace se = se[1,2] in `i'
replace counter = 19 in `i'

local i=`i'+1
mat b = e(b)
replace b = b[1,4] in `i'
mat se = e(se)
replace se = se[1,4] in `i'
replace counter = 18 in `i'








*** 80th vs. 20th percentile

cap prog drop boot_ineq
program define boot_ineq


gen ln_comp=.
gen ln_comp_tot=.

* 1st quintile, deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1 & nofreq_dlines==0 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==0 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==0 & nofreq_mtask==0

cap drop sum_amenities



* 1st quintile, deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1 & nofreq_dlines==0 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==0 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==0 & nofreq_mtask==1

cap drop sum_amenities



* 1st quintile, no deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1 & nofreq_dlines==1 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==1 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==1 & nofreq_mtask==0

cap drop sum_amenities



* 1st quintile, no deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1 & nofreq_dlines==1 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==1 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==1 & nofreq_dlines==1 & nofreq_mtask==1

cap drop sum_amenities








* 2nd quintile, deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2 & nofreq_dlines==0 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==0 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==0 & nofreq_mtask==0

cap drop sum_amenities



* 2nd quintile, deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2 & nofreq_dlines==0 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==0 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==0 & nofreq_mtask==1

cap drop sum_amenities



* 2nd quintile, no deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2 & nofreq_dlines==1 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==1 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==1 & nofreq_mtask==0

cap drop sum_amenities



* 2nd quintile, no deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2 & nofreq_dlines==1 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==1 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==2 & nofreq_dlines==1 & nofreq_mtask==1

cap drop sum_amenities





* 3rd quintile, deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3 & nofreq_dlines==0 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==0 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==0 & nofreq_mtask==0

cap drop sum_amenities



* 3rd quintile, deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3 & nofreq_dlines==0 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==0 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==0 & nofreq_mtask==1

cap drop sum_amenities



* 3rd quintile, no deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3 & nofreq_dlines==1 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==1 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==1 & nofreq_mtask==0

cap drop sum_amenities



* 3rd quintile, no deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3 & nofreq_dlines==1 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==1 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==3 & nofreq_dlines==1 & nofreq_mtask==1

cap drop sum_amenities




* 4th quintile, deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4 & nofreq_dlines==0 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==0 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==0 & nofreq_mtask==0

cap drop sum_amenities



* 4th quintile, deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4 & nofreq_dlines==0 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==0 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==0 & nofreq_mtask==1

cap drop sum_amenities



* 4th quintile, no deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4 & nofreq_dlines==1 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==1 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==1 & nofreq_mtask==0

cap drop sum_amenities



* 4th quintile, no deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4 & nofreq_dlines==1 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==1 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==4 & nofreq_dlines==1 & nofreq_mtask==1

cap drop sum_amenities





* 5th quintile, deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5 & nofreq_dlines==0 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==0 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==0 & nofreq_mtask==0

cap drop sum_amenities



* 5th quintile, deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5 & nofreq_dlines==0 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==0 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==0 & nofreq_mtask==1

cap drop sum_amenities



* 5th quintile, no deadlines and multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5 & nofreq_dlines==1 & nofreq_mtask==0, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==1 & nofreq_mtask==0

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==1 & nofreq_mtask==0

cap drop sum_amenities



* 5th quintile, no deadlines and no multitasking

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5 & nofreq_dlines==1 & nofreq_mtask==1, vce(cluster ls_id)

gen sum_amenities = has_flex*_b[d_flex]+has_tele_5*_b[d_tele_5]+has_tele_2*_b[d_tele_2]+has_daysoff30*_b[dc_daysoff_30] +has_daysoff35*_b[dc_daysoff_35]-has_commtime30*_b[dc_commtime_30]-has_commtime45*_b[dc_commtime_45]-has_commtime60*_b[dc_commtime_60]+_b[d_tele_2]*has_tele_2 + _b[d_tele_5]*has_tele_5

replace ln_comp = ln( wage + wage * ( 1- exp( ((_b[d_dlines]*nofreq_dlines + _b[d_mtask]*nofreq_mtask)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==1 & nofreq_mtask==1

replace ln_comp_tot = ln( wage + wage * ( 1- exp( ((sum_amenities)/_b[d_earn] *(-1) ) ) ) ) if quint==5 & nofreq_dlines==1 & nofreq_mtask==1


cap drop coef_d_tele_2 coef_d_tele_5 coef_wage sum_amenities

* wage gap
_pctile ln_wage, nq(100)
gen p_75 = `r(r80)'
gen p_25 = `r(r20)'
gen wage_gap = p_75-p_25
sum wage_gap 
scalar wage_gap = r(mean)
di wage_gap

cap drop p_75 p_25

* compensation gap
_pctile ln_comp, nq(100)
gen p_75 = `r(r80)'
gen p_25 = `r(r20)'
gen comp_gap = p_75-p_25
sum comp_gap 
scalar comp_gap = r(mean)
di comp_gap

cap drop p_75 p_25

* compensation gap
_pctile ln_comp_tot, nq(100)
gen p_75 = `r(r80)'
gen p_25 = `r(r20)'
gen comp_gap_tot = p_75-p_25
sum comp_gap_tot 
scalar comp_gap_tot = r(mean)
di comp_gap_tot


gen diff_pressure = comp_gap-wage_gap 
sum diff_pressure 
scalar diff_pressure = r(mean)
di diff_pressure

gen diff_tot = comp_gap_tot-wage_gap 
sum diff_tot 
scalar diff_tot = r(mean)
di diff_tot

cap drop ln_comp ln_comp_tot p_75 p_25 wage_gap comp_gap comp_gap_tot diff_pressure diff_tot sum_amenities

reg ln_wage

end 


bootstrap wage_gap comp_gap comp_gap_tot diff_pressure diff_tot, seed(2205) reps(200) cluster(ls_id): boot_ineq




local i=`i'+1
mat b = e(b)
replace b = b[1,1] in `i'
mat se = e(se)
replace se = se[1,1] in `i'
replace counter = 15 in `i'


local i=`i'+1
mat b = e(b)
replace b = b[1,2] in `i'
mat se = e(se)
replace se = se[1,2] in `i'
replace counter = 14 in `i'

local i=`i'+1
mat b = e(b)
replace b = b[1,4] in `i'
mat se = e(se)
replace se = se[1,4] in `i'
replace counter = 13 in `i'


keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.




twoway (rcap upper lower counter , horizontal color(black))  (scatter counter b if significant==1 , color(black) msymbol(dh) ) (scatter counter b if significant==0 , color(black) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(-0.1, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(-0.05, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.05, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.1, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.2, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.3, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.35, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.4, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.45, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.55, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.6, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.65, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.7, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(0.75, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(21 "{bf:High vs. low education}" 20 "Wage" 19 "Wage + pressure" 18 "{it:Difference}" 16 "{bf:80th vs. 20th percentile}" 15 "Wage" 14 "Wage + pressure" 13 "{it:Difference}", angle(0)  labsize(medium)) xtitle(Log difference)  ysize(4)  yscale(range(12 22)) xscale(range(-0.1 0.75)  titlegap(4))  xsize(5) xlabel(-0.1(0.1)0.7)   graphregion(margin(large)) scale(0.9) 


restore
}




























*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                     APPENDIX TABLES AND FIGURES                             /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////



*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                     Tables A7 and A8                                        /
*                     Descriptives on experimental sample                     /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{
preserve 

* One observation per individual
bysort ls_id: gen num_obs = _n
keep if num_obs==1

gen nowfh=telecomm==1
label var nowfh "No WFH"
gen wfh2=telecomm==2
label var wfh2 "WFH up to 2 days"
gen wfh5=telecomm==3
label var wfh5 "WFH up to 5 days"

gen sched_flex=has_flex==1
label var sched_flex "has_flexible schedule"

gen dlines_sometimes=dlines==1
label var dlines_sometimes "Sometimes"
gen dlines_often=dlines==2 
label var dlines_often "Often"
gen dlines_never=dlines==3
label var dlines_never "Never"

gen mtask_sometimes=mtask==1
label var mtask_sometimes "Sometimes"
gen mtask_often=mtask==2 
label var mtask_often "Often"
gen mtask_never=mtask==3
label var mtask_never "Never"

label var daysoff "Paid days off"

gen comm15=commtime==1 
label var comm15 "0-15 minutes"
gen comm30=commtime==2 
label var comm30 "16-30 minutes"
gen comm45=commtime==3 
label var comm45 "31-45 minutes"
gen comm60=commtime==4 
label var comm60 "46-60 minutes"
gen comm60plus=commtime==5 
label var comm60plus "$>$60 minutes"

label var hours "Weekly work hours"
label var wage "Gross hourly wage"


eststo clear
eststo:  estpost summarize nowfh wfh2 wfh5  
eststo:  estpost summarize nowfh wfh2 wfh5 if female==1
eststo:  estpost summarize nowfh wfh2 wfh5 if female==0
eststo:  estpost summarize nowfh wfh2 wfh5 if inlist(education,1,2,3)
eststo:  estpost summarize nowfh wfh2 wfh5 if inlist(education,4,5,6,7)
eststo:  estpost summarize nowfh wfh2 wfh5 if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize sched_flex  
eststo:  estpost summarize sched_flex if female==1
eststo:  estpost summarize sched_flex if female==0
eststo:  estpost summarize sched_flex if inlist(education,1,2,3)
eststo:  estpost summarize sched_flex if inlist(education,4,5,6,7)
eststo:  estpost summarize sched_flex if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize sched_flex  
eststo:  estpost summarize sched_flex if female==1
eststo:  estpost summarize sched_flex if female==0
eststo:  estpost summarize sched_flex if inlist(education,1,2,3)
eststo:  estpost summarize sched_flex if inlist(education,4,5,6,7)
eststo:  estpost summarize sched_flex if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often  
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if female==1
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if female==0
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if inlist(education,1,2,3)
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if inlist(education,4,5,6,7)
eststo:  estpost summarize dlines_never dlines_sometimes dlines_often if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often  
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if female==1
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if female==0
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if inlist(education,1,2,3)
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if inlist(education,4,5,6,7)
eststo:  estpost summarize mtask_never mtask_sometimes mtask_often if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize daysoff  
eststo:  estpost summarize daysoff if female==1
eststo:  estpost summarize daysoff if female==0
eststo:  estpost summarize daysoff if inlist(education,1,2,3)
eststo:  estpost summarize daysoff if inlist(education,4,5,6,7)
eststo:  estpost summarize daysoff if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus  
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if female==1
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if female==0
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if inlist(education,1,2,3)
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if inlist(education,4,5,6,7)
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear
eststo:  estpost summarize hours  
eststo:  estpost summarize hours if female==1
eststo:  estpost summarize hours if female==0
eststo:  estpost summarize hours if inlist(education,1,2,3)
eststo:  estpost summarize hours if inlist(education,4,5,6,7)
eststo:  estpost summarize hours if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear
eststo:  estpost summarize wage  
eststo:  estpost summarize wage if female==1
eststo:  estpost summarize wage if female==0
eststo:  estpost summarize wage if inlist(education,1,2,3)
eststo:  estpost summarize wage if inlist(education,4,5,6,7)
eststo:  estpost summarize wage if inlist(education,8,9)

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace



eststo clear 
eststo:  estpost summarize nowfh wfh2 wfh5 if age==2
eststo:  estpost summarize nowfh wfh2 wfh5 if age==3
eststo:  estpost summarize nowfh wfh2 wfh5 if age==4
eststo:  estpost summarize nowfh wfh2 wfh5 if age==5
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==1
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==2
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==3
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==4
eststo:  estpost summarize nowfh wfh2 wfh5 if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear 
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==2
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==3
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==4
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if age==5
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==1
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==2
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==3
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==4
eststo:  estpost summarize dlines_often dlines_sometimes dlines_never if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear 
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==2
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==3
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==4
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if age==5
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==1
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==2
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==3
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==4
eststo:  estpost summarize mtask_often mtask_sometimes mtask_never if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear 
eststo:  estpost summarize sched_flex if age==2
eststo:  estpost summarize sched_flex if age==3
eststo:  estpost summarize sched_flex if age==4
eststo:  estpost summarize sched_flex if age==5
eststo:  estpost summarize sched_flex if quint==1
eststo:  estpost summarize sched_flex if quint==2
eststo:  estpost summarize sched_flex if quint==3
eststo:  estpost summarize sched_flex if quint==4
eststo:  estpost summarize sched_flex if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace





eststo clear 
eststo:  estpost summarize daysoff if age==2
eststo:  estpost summarize daysoff if age==3
eststo:  estpost summarize daysoff if age==4
eststo:  estpost summarize daysoff if age==5
eststo:  estpost summarize daysoff if quint==1
eststo:  estpost summarize daysoff if quint==2
eststo:  estpost summarize daysoff if quint==3
eststo:  estpost summarize daysoff if quint==4
eststo:  estpost summarize daysoff if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear 
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==2
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==3
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==4
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if age==5
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==1
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==2
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==3
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==4
eststo:  estpost summarize comm15 comm30 comm45 comm60 comm60plus if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace


eststo clear 
eststo:  estpost summarize hours if age==2
eststo:  estpost summarize hours if age==3
eststo:  estpost summarize hours if age==4
eststo:  estpost summarize hours if age==5
eststo:  estpost summarize hours if quint==1
eststo:  estpost summarize hours if quint==2
eststo:  estpost summarize hours if quint==3
eststo:  estpost summarize hours if quint==4
eststo:  estpost summarize hours if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace

eststo clear 
eststo:  estpost summarize wage if age==2
eststo:  estpost summarize wage if age==3
eststo:  estpost summarize wage if age==4
eststo:  estpost summarize wage if age==5
eststo:  estpost summarize wage if quint==1
eststo:  estpost summarize wage if quint==2
eststo:  estpost summarize wage if quint==3
eststo:  estpost summarize wage if quint==4
eststo:  estpost summarize wage if quint==5

esttab, cells("mean(fmt(%9.2f)) ") collabels(none) fragment booktabs nodepvar noobs nomtitle nonumbers nodepvar nolines label  wide staraux  replace




restore
}







*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                      Table A.9                                              /
*                      Hedonic wage regressions                               /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{
preserve 

label var pressure "High pressure"
label var freq_dlines "Deadlines"
label var freq_mtask "Multitasking"

* One observation per individual
bysort ls_id: gen num_obs = _n
keep if num_obs==1


local y ln_income_100

quietly{	
reg `y' pressure, vce(cluster ls_id)
estimates store r1
estadd ysumm

reg `y' pressure high_edu med_edu i.age female, vce(cluster ls_id)
estimates store r2
estadd ysumm

reg `y' pressure high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
estimates store r3
estadd ysumm

reg `y' freq_dlines freq_mtask, vce(cluster ls_id)
estimates store r4
estadd ysumm

reg `y' freq_dlines freq_mtask high_edu med_edu i.age female, vce(cluster ls_id)
estimates store r5
estadd ysumm

reg `y' freq_dlines freq_mtask high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
estimates store r6
estadd ysumm

}


estout  r1 r2 r3 r4 r5 r6, cells(b(fmt(2) star) se(fmt(2) par))  stats(r2_a, fmt(%9.2f) labels(`"Adj. R2"')) ///
starlevels(`"\sym{*}"' 0.10 `"\sym{**}"' 0.05 `"\sym{***}"' 0.01, label(" \(p<@\)")) delimiter(&) end(\\) ///
prefoot("\hline") label mlabels(none) nonumbers collabels(none) keep(pressure freq_dlines freq_mtask) order (treatment ) eqlabels("", begin("\hline" "") nofirst) notype ///
level(95) style(esttab)  replace






local y ln_hours_100

quietly{	
reg `y' pressure, vce(cluster ls_id)
estimates store r1
estadd ysumm

reg `y' pressure high_edu med_edu i.age female, vce(cluster ls_id)
estimates store r2
estadd ysumm

reg `y' pressure high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
estimates store r3
estadd ysumm

reg `y' freq_dlines freq_mtask, vce(cluster ls_id)
estimates store r4
estadd ysumm

reg `y' freq_dlines freq_mtask high_edu med_edu i.age female, vce(cluster ls_id)
estimates store r5
estadd ysumm

reg `y' freq_dlines freq_mtask high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
estimates store r6
estadd ysumm

}


estout  r1 r2 r3 r4 r5 r6, cells(b(fmt(2) star) se(fmt(2) par))  stats(r2_a, fmt(%9.2f) labels(`"Adj. R2"')) ///
starlevels(`"\sym{*}"' 0.10 `"\sym{**}"' 0.05 `"\sym{***}"' 0.01, label(" \(p<@\)")) delimiter(&) end(\\) ///
prefoot("\hline") label mlabels(none) nonumbers collabels(none) keep(pressure freq_dlines freq_mtask) order (treatment ) eqlabels("", begin("\hline" "") nofirst) notype ///
level(95) style(esttab)  replace





local y ln_wage_100

quietly{	
reg `y' pressure, vce(cluster ls_id)
estimates store r1
estadd ysumm

reg `y' pressure high_edu med_edu i.age female, vce(cluster ls_id)
estimates store r2
estadd ysumm

reg `y' pressure high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
estimates store r3
estadd ysumm

reg `y' freq_dlines freq_mtask, vce(cluster ls_id)
estimates store r4
estadd ysumm

reg `y' freq_dlines freq_mtask high_edu med_edu i.age female, vce(cluster ls_id)
estimates store r5
estadd ysumm

reg `y' freq_dlines freq_mtask high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
estimates store r6
estadd ysumm

}


estout  r1 r2 r3 r4 r5 r6, cells(b(fmt(2) star) se(fmt(2) par))  stats(r2_a, fmt(%9.2f) labels(`"Adj. R2"')) ///
starlevels(`"\sym{*}"' 0.10 `"\sym{**}"' 0.05 `"\sym{***}"' 0.01, label(" \(p<@\)")) delimiter(&) end(\\) ///
prefoot("\hline") label mlabels(none) nonumbers collabels(none) keep(pressure freq_dlines freq_mtask) order (treatment ) eqlabels("", begin("\hline" "") nofirst) notype ///
level(95) style(esttab)  replace


restore
}







*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                         Figure A.11                                         /
*                         Link between pressure and health                    /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{
preserve

* One observation per individual
bysort ls_id: gen num_obs = _n
keep if num_obs==1


local x pressure

local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

local i=`i'+1
reg sleep `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 20 in `i'

local i=`i'+1
reg tired `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 19 in `i'

local i=`i'+1
reg nervous `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 18 in `i'

local i=`i'+1
reg ment_exh `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 17 in `i'

local i=`i'+1
reg phys_exh `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 16 in `i'

local i=`i'+1
reg taxing `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 15 in `i'

local i=`i'+1
reg relax `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 14 in `i'

local i=`i'+1
reg overwhelmed `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 13 in `i'

local i=`i'+1
reg stress_increased `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 12 in `i'

local i=`i'+1
reg limit `x' high_edu med_edu i.age female daysoff i.has_flex i.telecomm i.commtime, vce(cluster ls_id)
replace b = _b[`x'] in `i'
replace se = _se[`x'] in `i'

replace counter = 11 in `i'



keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  ///
(scatter counter b if significant==1 , color(red) msymbol(d) ) ///
(scatter counter b if significant==0 , color(edkblue) msymbol(dh)) ///
, ytitle("") legend(off) ///
xline(0, lpattern(dash)) ///
xline(0.05, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.1, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.15, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.2, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.25, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.3, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.35, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.4, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.45, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
xline(0.5, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
ylabel(20 "Sleep problems" 19 "Tired" 18 "Nervous" 17 "Mentally exhausted" 16 "Physically exhausted" 15 "Finds work emotionally taxing" 14 "Finds it hard to relax after work" 13 "Overwhelmed by too much work" 12 "Stress has increased over past two years" 11 "Reaches personal limit often", angle(0)  labsize(medium)) xtitle(Coefficient of pressure index)  ysize(4)  yscale(range(10 21)) xscale(range(0 0.5)  titlegap(4))  xsize(6) xlabel(0(0.05)0.5)   graphregion(margin(large)) scale(0.9) 



restore
}






*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                  Figure A.12, panel (a)                                     /
*                  Baseline results, including non-attentive participants     /
*                  WTP to avoid tight deadlines                               /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

use "$orig\HighPressure_all", clear // use sample with all participants


{

preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==2 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==3 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==4 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==5 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,1,2,3)  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,4,5,6,7)  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 6 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,8,9)  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==1  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==0  & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -6 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(9.677827, lpattern(dash) lcolor(gs8) lwidth(vthin))  ylabel(20 "{bf:All}" 18 "{bf:Gender}" 17 "Female" 16 "Male" 14 "{bf:Age}" 13 "20-29" 12 "30-39" 11 "40-49" 10 "50-60" 8 "{bf:Education}" 7 "Low" 6 "Medium" 5 "High" 3 "{bf:Wage quintile}" 2 "1st (lowest)" 1 "2nd" 0 "3rd" -1 "4th" -2 "5th (highest)" -4 "{bf: Bad health index}" -5 "Above median" -6 "Below median", angle(0)  labsize(small)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(-7 21)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore

}




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                  Figure A.12, panel (b)                                     /
*                  Baseline results, including non-attentive participants     /
*                  WTP to avoid multitasking                                  /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{

preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 20 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==1 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 17 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if female==0 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 16 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==2 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 13 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==3 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 12 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==4 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 11 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if age==5 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 10 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,1,2,3) & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 7 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,4,5,6,7) & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 6 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if inlist(education,8,9) & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==1 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==2 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==3 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 0 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==4 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -1 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if quint==5 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -2 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==1 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -5 in `i'

logit jobA d_earn d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* dc_hours_* if bad_health==0 & attent1==1 & attent2==1, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = -6 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(7.073407, lpattern(dash) lcolor(gs8) lwidth(vthin))  ylabel(20 "{bf:All}" 18 "{bf:Gender}" 17 "Female" 16 "Male" 14 "{bf:Age}" 13 "20-29" 12 "30-39" 11 "40-49" 10 "50-60" 8 "{bf:Education}" 7 "Low" 6 "Medium" 5 "High" 3 "{bf:Wage quintile}" 2 "1st (lowest)" 1 "2nd" 0 "3rd" -1 "4th" -2 "5th (highest)" -4 "{bf: Bad health index}" -5 "Above median" -6 "Below median", angle(0)  labsize(small)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(-7 21)) xscale(range(0 15)  titlegap(4))  xsize(5) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore


}
















*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                  Figure A.13, panel (a)                                     /
*                  Sorting, older workers                                     /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

use "$orig\HighPressure_attent", clear // back to attentive sample


{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==1 & inlist(age,4,5), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==0 & inlist(age,4,5), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==1 & inlist(age,4,5), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==0 & inlist(age,4,5), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(20 "{bf:Frequent deadlines in current job?}" 19 "Yes" 18 "No" 16 "{bf:Frequent multitasking in current job?}" 15 "Yes" 14 "No", angle(0)  labsize(vlarge)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(13 21)) xscale(range(0 15) titlegap(4))  xsize(6) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore

}



*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                  Figure A.13, panel (b)                                     /
*                  Sorting, younger workers                                   /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==1 & inlist(age,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==0 & inlist(age,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==1 & inlist(age,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==0 & inlist(age,2,3), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(20 "{bf:Frequent deadlines in current job?}" 19 "Yes" 18 "No" 16 "{bf:Frequent multitasking in current job?}" 15 "Yes" 14 "No", angle(0)  labsize(vlarge)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(13 21)) xscale(range(0 15) titlegap(4))  xsize(6) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore

}







*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                  Figure A.13, panel (c)                                     /
*                  Sorting, highly educated workers                           /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==1 & inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==0 & inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==1 & inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==0 & inlist(education,8,9), vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(20 "{bf:Frequent deadlines in current job?}" 19 "Yes" 18 "No" 16 "{bf:Frequent multitasking in current job?}" 15 "Yes" 14 "No", angle(0)  labsize(vlarge)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(13 21)) xscale(range(0 15) titlegap(4))  xsize(6) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore

}






*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                  Figure A.13, panel (d)                                     /
*                  Sorting, medium and low-educated workers                   /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


{
preserve
local i=0

gen b=.
gen se=.
gen counter=.
gen yvar=""
gen split=""

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==1 & education<8, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 19 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_dlines==0 & education<8, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_dlines]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 18 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==1 & education<8, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 15 in `i'

logit jobA dc_hours_*  d_flex d_tele_5 d_tele_2 d_dlines d_mtask dc_daysoff* dc_commtime_* d_earn if freq_mtask==0 & education<8, vce(cluster ls_id)

local i=`i'+1
nlcom (1-exp((_b[d_mtask]/_b[d_earn])*(-1)))*100
mat b = r(b)
replace b = b[1,1] in `i'
mat var = r(V)
replace se = (var[1,1])^0.5 in `i'
replace counter = 14 in `i'




keep b se counter 
drop if b==.

gen upper = b + 1.96*se
gen lower = b - 1.96*se
gen significant = upper<0 | lower>0 | upper>0
replace lower=. if upper==.



twoway (rcap upper lower counter , horizontal color(edkblue))  (scatter counter b if significant==1 , color(red) msymbol(d) ) (scatter counter b if significant==0 , color(edkblue) msymbol(dh)), ytitle("") legend(off) xline(0, lpattern(dash)) xline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(15, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) xline(25, lpattern(dash) lcolor(gs13) lwidth(vthin))  ylabel(20 "{bf:Frequent deadlines in current job?}" 19 "Yes" 18 "No" 16 "{bf:Frequent multitasking in current job?}" 15 "Yes" 14 "No", angle(0)  labsize(vlarge)) xtitle(Estimated WTP in % of wage)  ysize(4)  yscale(range(13 21)) xscale(range(0 15) titlegap(4))  xsize(6) xlabel(0(5)15)   graphregion(margin(large)) scale(0.9) 



restore

}



















